package cn.gson.work.model.pojos;

import javax.persistence.*;
import java.util.Date;

@Entity
public class Resource {
    private long resId;
    private String resName;
    private String resStage;
    private String resRemark;
    private Date resTime;
    private long typeId;
    private long deptNo;
    private Resourcetype resourcetype;
    private Dept dept;

    @ManyToOne
    @JoinColumn(name="TYPE_ID",insertable = false,updatable = false)
    public Resourcetype getResourcetype() {
        return resourcetype;
    }

    public void setResourcetype(Resourcetype resourcetype) {
        this.resourcetype = resourcetype;
    }

    @ManyToOne
    @JoinColumn(name="DEPT_NO",insertable = false,updatable = false)
    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    @Basic
    @Column(name = "TYPE_ID")
    public long getTypeId() {
        return typeId;
    }

    public void setTypeId(long typeId) {
        this.typeId = typeId;
    }

    @Basic
    @Column(name = "DEPT_NO")
    public long getDeptNo() {
        return deptNo;
    }

    public void setDeptNo(long deptNo) {
        this.deptNo = deptNo;
    }

    @Id
    @Column(name = "RES_ID")
    public long getResId() {
        return resId;
    }

    public void setResId(long resId) {
        this.resId = resId;
    }

    @Basic
    @Column(name = "RES_NAME")
    public String getResName() {
        return resName;
    }

    public void setResName(String resName) {
        this.resName = resName;
    }

    @Basic
    @Column(name = "RES_TIME")
    public Date getResTime() {
        return resTime;
    }

    public void setResTime(Date resTime) {
        this.resTime = resTime;
    }

    @Basic
    @Column(name = "RES_STAGE")
    public String getResStage() {
        return resStage;
    }

    public void setResStage(String resStage) {
        this.resStage = resStage;
    }

    @Basic
    @Column(name = "RES_REMARK")
    public String getResRemark() {
        return resRemark;
    }

    public void setResRemark(String resRemark) {
        this.resRemark = resRemark;
    }

    @Override
    public String toString() {
        return "Resource{" +
                "resId=" + resId +
                ", resName='" + resName + '\'' +
                ", resStage='" + resStage + '\'' +
                ", resRemark='" + resRemark + '\'' +
                ", resTime=" + resTime +
                ", typeId=" + typeId +
                ", deptNo=" + deptNo +
                ", resourcetype=" + resourcetype +
                ", dept=" + dept +
                '}';
    }
}
